<?php

class Plugin
{

    static $loadedPlugins = array();

    static function load($pluginName) {
        if (! in_array($pluginName, self::$loadedPlugins)) {
            require_once ROOT . DS . 'plugins' . DS . 'p_' . $pluginName . '.php';
            self::$loadedPlugins[] = $pluginName;
        }
        
        $pluginName = 'Plugin_' . $pluginName;
        $instance = new $pluginName();
        return $instance;
    }
    

}